<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
	<meta name="description" content="personal blog login page" />
	<meta name="author" content="lihongpeng" />
	<title>文章详情</title>
	<link rel="stylesheet" href="/css/bootstrap.min.css" />
	<link rel="stylesheet" href="/css/jianyi-style.css" />
	<!--[if lt IE 9]>
	<script src="https://cdn.bootcss.com/html5shiv/r29/html5.min.js"></script>
	<![endif]-->
</head>

<body>
<#include "/common/header.html" />
<div class="container jy-content">
	<div class="jy-detail-content">
		<h1 align="center">${article.articleName!''}</h1>
		<div class="jy-detail-user">
			<img src="<#if article.userVO.userInfoVO??>${article.userVO.userInfoVO.avatarUrl!''}<#else>/img/camera.png</#if>" />
			<a><#if  article.userVO.userInfoVO??>${ article.userVO.userInfoVO.userName!''}<#else></#if></a>
			<span><#if article.userVO.userInfoVO??>${article.userVO.userInfoVO.says!'这个作者没有添加个性签名'}</#if></span>
			<#if article.userVO?exists && user?exists && article.userVO.id!=user.id ><button onclick="ARTICLE_DETAIL.addOrCancelAttention(${ article.userId!''},${user.id},this)"><#if article.attention??>已关注<#else>关注</#if></button><#elseif article.userVO?exists && user?exists && article.userVO.id==user.id><#else><button onclick="ARTICLE_DETAIL.addOrCancelAttention(${ article.userId!''},null,this)"><#if article.attention??>已关注<#else>关注</#if></button></#if>
		</div>
		<hr  />
		<!--文章内容-->
		<#if article.articleContentVO??>${article.articleContentVO.acticleContent!'<h1>这篇博客好像走丢了，先看看别的。。。</h1>'}<#else></#if>
		<hr />
	</div>
	<div class="jy-comment-content">
		<div class="jy-send-comment clearfix">
			<!--当前登录用户头像-->
            <img src="<#if user??>${user.userInfoVO.avatarUrl}<#else>http://image.jianyiblog.com/files/avatar/default/default-avatar.png</#if>" alt="avatar" />
            <textarea name="" rows="" cols="" id="article-comment-id" placeholder="写下你的评论..."></textarea>
			<button type="button" id="article-comment-submit-id" onclick="ARTICLE_COMMENT.publishComment(${article.id!''},<#if user??>true</#if>)" class="btn btn-success pull-right mar-left">发表</button>
			<button type="button" class="btn btn-default pull-right">取消</button>
        </div>
        <hr />
		<ul class="comment-list">
			<li>
				<#if article.userCommentVOS??>
					<#list article.userCommentVOS as comment>
						<div class="jy-detail-user">
							<img src="<#if comment.userInfoVO.avatarUrl?contains('http:')>${(comment.userInfoVO.avatarUrl)}<#elseif comment.userInfoVO.avatarUrl?contains('files')>http://image.jianyiblog.com/${(comment.userInfoVO.avatarUrl)}</#if>" />
							<a>${comment.userInfoVO.userName!''}</a>
							<span>评论时间 · ${comment.commitTime?string("yyyy-MM-dd HH:mm:ss")}</span>
						</div>
						<p>${comment.commitContent!''}</p>
						<div class="btn-more clearfix">
							<a href="/praise/"><span class="glyphicon glyphicon-thumbs-up"></span> 点赞</a>
							<a href="javascript:;"><span class="glyphicon glyphicon-comment"></span> 回复</a>
							<a href=""><span class="glyphicon glyphicon-exclamation-sign"></span> 举报</a>
						</div>
						<#if comment.commentReplays??>
							<#list comment.commentReplays as commentReplay>
								<div class="comment-reply">
									<div class="comment-reply-user clearfix">
										<p>
											<a>${commentReplay.userInfoVO.userName!''}</a> 回复
											<a>${commentReplay.userInfoVOReplay.userName!''}</a>：${commentReplay.commitContent!''}
										</p>
										<span>${commentReplay.commitTime?string("yyyy-MM-dd HH:mm:ss")}</span>
										<a href="javascript:;"  onclick="ARTICLE_COMMENT.textAreaControl(this,<#if user??>true</#if>)" ><span class="glyphicon glyphicon-comment"></span> 回复</a>
										<div is-active="un-active" class="comment-replay">
											<hr class="dashed"/>
											<a href=""><span class="glyphicon glyphicon-pencil"></span>添加回复信息</a>
											<textarea name="article-comment" value="" rows="" cols="" placeholder="@${commentReplay.userInfoVO.userName!''}"></textarea>
											<button type="button" onclick="ARTICLE_COMMENT.publishCommentReplay(${commentReplay.commitUserId!''},${comment.id!''},this,<#if user??>true</#if>)" class="btn btn-success pull-right mar-left">发表
											</button>
											<button type="button" class="btn btn-default pull-right">取消</button>
										</div>
									</div>
								</div>
							</#list>
						</#if>
						<div class="comment-reply">
							<div class="comment-reply-user clearfix">
								<div id="${comment.id!''}">
									<hr class="dashed"/>
									<a href=""><span class="glyphicon glyphicon-pencil"></span>回复评论</a>
									<textarea name="article-comment" value="" rows="" cols="" placeholder="@${comment.userInfoVO.userName!''}"></textarea>
									<button type="button" onclick="ARTICLE_COMMENT.publishCommentReplay(${comment.commitUserId!''},${comment.id!''},this,<#if user??>true</#if>)" class="btn btn-success pull-right mar-left">发表
									</button>
									<button type="button" class="btn btn-default pull-right">取消</button>
								</div>
							</div>
						</div>
						<hr />
					</#list>
				</#if>

			</li>
		</ul>
		<nav class="text-center" aria-label="...">
			<ul class="pagination">
				<li class="disabled">
					<a href="#" aria-label="Previous"><span aria-hidden="true">上一页</span></a>
				</li>
				<li class="active">
					<span>1 <span class="sr-only">(current)</span></span>
				</li>
				<li>
					<span>2 <span class="sr-only">(current)</span></span>
				</li>
				<li>
					<span>3 <span class="sr-only">(current)</span></span>
				</li>
				<li>
					<span>4 <span class="sr-only">(current)</span></span>
				</li>
				<li>
					<a href="#" aria-label="Next"><span aria-hidden="true">下一页</span></a>
				</li>
			</ul>
		</nav>
	</div>
</div>

<footer class="container">
	<hr />
	<a href="">关于简易</a><i>·</i>
	<a href="">联系我们</a><i>·</i>
	<a href="">加入我们</a><i>·</i>
	<a href="">作者出书计划</a><i>·</i>
	<a href="">帮助中心</a><i>·</i>
	<a href="">合作伙伴</a>
	<div class="icp">
		©2017-2017 北京简易科技有限公司 / Tel:021-61995350 / 简易 / 京ICP备11018329号-5 / 京公网安备00000000000号
		<a target="_blank" href="#">
			<img src="" alt="Smrz">
		</a>
	</div>
</footer>
<script type="text/javascript" src="${basePath}/js/plugins/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="${basePath}/js/plugins/layer.js"></script>
<script type="text/javascript" src="${basePath}/js/plugins/bootstrap.min.js"></script>
<script type="text/javascript" src="${basePath}/js/plugins/back-top.js"></script>
<script type="text/javascript" src="${basePath}/js/ourjs/article/article-detail.js"></script>
<script type="text/javascript" src="${basePath}/js/ourjs/common/common_validate.js"></script>
<script type="text/javascript" src="${basePath}/js/ourjs/comment/comment.js"></script>
<script>
    (function(win, doc) {
        $(doc).on('click', '.list-group-item', function() {
            win.location.href = $(this).attr('href');
        });
        $(doc).on('click', '#write-article', function() {
            win.location.href = "/article/toWriteArticle";
        });
        $(".comment-replay").css('display','none');
        $('#myButton').on('click', function() {
            var $btn = $(this).button('loading');
            setTimeout(function() {
                $btn.button('reset');
            }, 2000);
        });
        var sopportTouch = "ontouchstart" in doc,
            tapStart = sopportTouch ? "touchstart" : "mousedown",
            tapEnd = sopportTouch ? "touchend" : "mouseup",
            searchDom = doc.getElementById('searchInput');
        searchDom.addEventListener('focus', function() {
            this.parentElement.className = 'form-search-act';
        });
        searchDom.addEventListener('blur', function() {
            this.parentElement.className = 'form-search';
        });
    })(window, document);
</script>
</body>

</html>